<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
*{font-family:Tahoma, Arial, Helvetica, Sans-serif,"宋体";}
table{
	width:85%;
	margin:0px auto;
	font:Georgia 11px;
	font-size:12px;
	color:#333333;
	text-align:center;
	border-collapse:collapse;/*细线表格代码*/
}
table td{
	border:1px solid #999;/*细线表格线条颜色*/
	height:22px;
}
caption{text-align:center;font-size:12px;font-weight:bold;margin:0 auto;}
tr.t1 td {background-color:#fff;}
tr.t2 td {background-color:#eee;}
tr.t3 td {background-color:#ccc;}
th,tfoot tr td{font-weight:bold;text-align:center;background:#c5c5c5;}
th{line-height:30px;height:30px;}
tfoot tr td{background:#fff;line-height:26px;height:26px;}
thead{border:1px solid #999;}
thead tr td{text-align:center;}
#page{text-align:center;float:right;}
#page a,#page a:visited{width:60px;height:22px;line-height:22px;border:1px black solid;display:block;float:left;margin:0 3px;background:#c9c9c9;
text-decoration:none;}
#page a:hover{background:#c1c1c1;text-decoration:none;}
.grayr {padding:2px;font-size:11px;background:#fff;float:right;}
.grayr a {padding:2px 5px;margin:2px;color:#000;text-decoration:none;;border:1px #c0c0c0 solid;}
.grayr a:hover {color:#000;border:1px orange solid;}
.grayr a:active {color:#000;background: #99ffff}
.grayr span.current {padding:2px 5px;font-weight:bold; margin:2px; color: #303030;background:#fff;border:1px orange solid;}
.grayr span.disabled {padding:2px 5px;margin:2px;color:#797979;background: #c1c1c1;border:1px #c1c1c1 solid;}
a{
	text-decoration:none;
	}
	img{
		border:0px;}
-->
</style>
<script src="../admin_core/templates/admin/js/list.js"></script>
<script type="text/javascript"><!--
function selectPage(obj)
{

	var value = obj.value;
	document.location.href="controlLs.php?action=searchHW&page="+value+"&countPage=#{$countPage}#&count=#{$count}#&keyword=#{$keyword}#&before=#{$before}#&after=#{$after}#&type=#{$type}#&hwType=#{$hwType}#";
	}
	function select()
	{
		var logList =  document.getElementsByName("hwId[]");
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			obj.checked =!obj.checked;
			}
		
	}
	function checkChecked()
	{
		var logList =  document.getElementsByName("hwId[]");
		var checkState = false;
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			if(obj.checked)
				{
				checkState = true;
				}
			
			}
		if(!checkState)
			{
			alert("至少选中一个！");
			}
		else
			{
			if(confirm("确认删除吗？"))
			document.getElementById('selectForm').submit();
			}
	}
function search()
{
	var keyWord = document.getElementById('keword').value;
	var type = document.getElementById('searchtype').value;
	var before=document.getElementById('before').value;
	var after=document.getElementById('after').value;
	var hwType = document.getElementById('hwType').value;
	
		if(before=="")
		{
			before=0;
			}
			if(after=="")
			{
				after=0;
				}
				if(type!=3)
						{
							if(before=="")
							{
							alert("请选择一个开始时间！");
							document.getElementById('before').focus();
							return ;
							}
							else if(after=="")
							{
								
								alert("请选择一个结束时间！");
								document.getElementById('after').focus();
								return ;
								}
						}
	document.location.href="controlLs.php?action=searchHW&keyword="+keyWord+"&type="+type+"&before="+before+"&after="+after+"&hwType="+hwType;
	}
		function checkSubmitDetail(hwId)
	{
		window.open('../submitHW.php?hwId='+hwId,'提交信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
		}
		function readHWDetails(hwId)
		{
			window.open('../readHW.php?hwId='+hwId,'作业信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
			}
--></script>
<script type="text/javascript" src="date/WdatePicker.js"></script>
</head>

<body style="text-align:center;">
<center>
<br />
<fieldset style="width:1110px;">
<legend><span style="color:#000; font-size:14px; font-weight:bold;"><img src="images/search_16x16.gif" width="16" height="16" />&nbsp;搜索作业
</span></legend>
<span style="font-size:12px; font-weight:bold;">
<div style="clear:both; height:10px;">
</div>
<span style="float:left; margin-left:50px; ">
设定提交时间搜索：
<select name="searchtype" id="searchtype" style="width:140px; height:20px; color:#09C; border:#999 1px solid;"  onchange="if(this.value!=3){document.getElementById('before').focus();}
">
  <option value="3" > 常规搜索 </option>
  <option value="1"> 设定开始提交时间 </option>
  <option value="2"> 设定截至提交时间 </option>
</select>
时间上限：
<input  type="text" name="before" id="before" readonly="readonly"  class="Wdate"onfocus="var after=$dp.$('after');WdatePicker({onpicked:function(){after.focus();},maxDate:'#F{$dp.$D(\'after\')}'})"
 style="width:150px; height:20px; color:#09C;" />
 时间下限：
 <input  type="text" name="after" id="after" readonly="readonly"  class="Wdate" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'before\')}'})" style="width:150px; height:20px; color:#09C;" >
</span>
 <div style="clear:both; height:10px;">
 </div>
 <span style="float:left; margin-left:50px;">
作业类型：
<select name="hwType" id="hwType" style=" height:20px; color:#09C; border:#999 1px solid;">
<option value="3" 
#{if $hwType==3}#
selected="selected"
#{/if}#
>任意</option>
<option value="1"
#{if $hwType==1}#
selected="selected"
#{/if}#
>选做</option>
<option value="2"
#{if $hwType==2}#
selected="selected"
#{/if}#
>必做</option>
</select>
</span>
<div style="clear:both; height:10px;">
</div>
<span style="float:left; margin-left:50px;">
请输入作业名或者作业名包含的关键词：
<input  type="text" name="keword" id="keword" 
 style="width:180px; height:20px; color:#09C; border:#999 1px solid;" />&nbsp;&nbsp;
 <input type="button" value=" 搜 索 " onclick="search()" style="width:80px; height:25px;" />
</span>
</span>
</fieldset>
<br />
<fieldset style="width:1110px;">
<legend><img src="images/311.gif"/>&nbsp;<span style="color:#333; font-size:15px; font-weight:bold;">作业列表</span></legend>
<form id="selectForm" action="controlLs.php?action=deleteHW" method="post">


<table width="100%">

  <thead>
    <tr>
      <th width="10%" onclick="select()" style="cursor: pointer;" title="全选/反选">全选/反选</th>
      <th width="20%">作业标题</th>
      
      <th width="15%">开始提交时间</th>
      <th width="15%">截至提交时间</th>
       <th width="10%">作业类型</th>
        <th >操作</th>
    </tr>
  </thead>
  <tbody id="tab">
#{if $count==0}#
<tr>
<td style="text-align:center; " colspan="6">
暂无数据!
</td>
</tr>
#{else}#
    #{foreach from=$list item=hw}#
      <tr onmousemove="changeBackColor(this)" onmouseout="removeBackColor(this)">
      <td width="10%" align="center">
      <input name="hwId[]" type="checkbox" value="#{$hw->getWt_id()}#" />
      </td>
      <td width="20%" align="left" onclick="readHWDetails(#{$hw->getWt_id()}#)" style="cursor:pointer; padding-left:5px;" title="点击查看详细信息">#{$hw->getWt_name()|truncate:28:"...."}#</td>
      
      <td width="15%" align="center">#{$hw->getStart_time()|date_format:'%Y-%m-%d'}#</td>
      <td width="15%" align="center">#{$hw->getStart_time()|date_format:'%Y-%m-%d'}#</td>
       <td width="10%" align="center">
       #{if $hw->getWt_type()==1}#
       必做
       #{else}#
       选做
		#{/if}#
       </td>
       <td>
     <a href="#" onclick="readHWDetails(#{$hw->getWt_id()}#)" title="查看该作业详细信息">  <img src="images/view_16x16.gif" title="获取详细信息" width="14" height="14"/>查看详细信息</a>&nbsp;<a href="../modifyHomework.php?hwId=#{$hw->getWt_id()}#"><img title="修改该新闻信息" src="images/table_(edit)_16x16.gif" width="14" height="14"/>修改</a>&nbsp;<a href="#" onclick="checkSubmitDetail(#{$hw->getWt_id()}#)" title="获取详细信息" ><img src="images/view_16x16.gif" title="获取详细信息"  width="14" height="14"/>查看作业提交情况</a>
       </td>
      </tr>
 #{/foreach}#
 
 <tr>
 <td align="center" style="border-right:0px; cursor: pointer; border-right:#999 1px solid;"  onclick="select()" title="全选/反选">
 全选/反选
 </td>
 <td colspan="5" align="left" style="text-align:left; border-left:0px;">
 <input type="button" value=" 删除选中记录 "   style="font-size:13px; width:100px; height:25px;" onclick="checkChecked()"/> 
 </td>
 </tr>
 #{/if}#
  </tbody>
  <tfoot>
  
  <tr>
  <td colspan="6" align="right" style="text-align:right;">
  共有#{$count}#条记录 总共有#{$countPage}#页 当前为#{$start}#-#{$end}#条 在第#{$nowPage}#页
  #{if $nowPage==1}#
 上一页
  #{else}#
  <a href="controlLs.php?action=searchHW&page=#{$nowPage-1}#&countPage=#{$countPage}#&count=#{$count}#&keyword=#{$keyword}#&before=#{$before}#&after=#{$after}#&type=#{$type}#&hwType=#{$hwType}#">上一页</a>
  #{/if}#

  #{if $countPage>$nowPage}#
   <a href="controlLs.php?action=searchHW&page=#{$nowPage+1}#&countPage=#{$countPage}#&count=#{$count}#&keyword=#{$keyword}#&before=#{$before}#&after=#{$after}#&type=#{$type}#&hwType=#{$hwType}#"> 下一页</a>
  #{else}#
  下一页
  #{/if}#
  跳至<select onchange="selectPage(this)">
  #{section loop=$countPage name=a}#
<option value="#{$smarty.section.a.iteration}#" #{if $smarty.section.a.iteration==$nowPage}# selected="selected"#{/if}#>#{$smarty.section.a.iteration}#页</option>
#{/section}#
</select>
  &nbsp;&nbsp;
  
  </td>
  </tr>
  </tfoot>
  
</table>
</form>
</fieldset>
</center>
</body>
</html>
